blob: b3c5b40ae66a318d5deba3392139bef847feb90a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
---
import { getCollection, render } from "astro:content";
import ArticlePage from "../layouts/ArticlePage.astro";
export async function getStaticPaths() {
const posts = await getCollection("blogs");
return posts.map((post) => ({
params: { id: post.id },
props: { post },
}));
}
const { post } = Astro.props;
const { Content } = await render(post);
---
<ArticlePage id={post.id} data={post.data}><Content /></ArticlePage>
|